{% load User_tags %}
{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!--Bootstrap-->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!--自适应样式-->
    <link rel="stylesheet" type="text/css" href="/static/css/responsive.css">
    <!--Font Awesome 图标web link-->
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.css">
    <!-- 标题栏logo-->
    <link rel="icon" href="/static/images/logo.ico" type="image/x-icon">
    <!-- 收藏夹logo-->
    <link rel="stylesheet" href="{% static 'css/style.css' %}">
    <link rel="shortcut icon" href="/static/images/logo.ico" type="image/x-icon">
    {% block csslink %}要替换的css link{%endblock%}
    <meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
    <title>{% block title %} 登录 {% endblock %}</title>
    <style type="text/css">


    </style>

    {% block css %}
    <style type="text/css"></style>
    {%endblock%}
</head>

<body>
    <!--Start Header-->
    <header id="mu-header" class="headerbg" role="banner">
        <div class="container">
            <nav class="navbar navbar-default mu-navbar">
                <div class="container-fluid">
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <!-- Text Logo -->
                        <a class="navbar-brand" href="/">菜根譚</a>
                        <!-- Image Logo -->
                        <!-- <a class="navbar-brand" href="#"><img src="assets/images/logo.png"></a> -->
                    </div>
                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                        <ul class="nav navbar-nav mu-menu navbar-right">
                            <li><a href="/index/">主页</a></li>

                            <li>
                                <!--Django模板语音用is_authenticated判断是否登录 -->
                                {% if user.is_authenticated %}
                                <a href="/accounts/login/" title="{{ user.username }}">
                                    <span class="glyphicon glyphicon-user" aria-hidden=" true"></span>
                                </a>
                                {% endif %}
                                {% if not user.is_authenticated %}
                                <a href="/accounts/login/" title="登录">
                                    <span class="glyphicon glyphicon-log-in  aria-hidden=" true"></span>
                                </a>
                                {% endif %}
                            <li>
                        </ul>
                    </div><!-- /.navbar-collapse -->
                </div><!-- /.container-fluid -->
            </nav>
        </div>
    </header>
    <!--End Header -->


    <!--Start banner -->
    <banner class='banner'>
        <div id="mu-featured-slider">
            <div class="header-banner">
            </div>
        </div>
    </banner>
    <!--End banner-->
    <section class="container" id="section">
        <div class="section-content">
            {% block content %}
            <div>要替换的内容</div>
            {% endblock %}
        </div>
    </section>
    <!--footer-->
    <footer class="footerbg fixed">
        基于Django构建 © 2020
        |
        菜根譚&#8197;
        |
        <a href="http://www.miitbeian.gov.cn">渝ICP备19006782号-1</a>

        |
        <a href="/sitemap.xml" title="Sitemap" target="_blank">网站地图</a>
    </footer>
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    {% block js %} 要替换的js {% endblock %}
    <script type="text/javascript">
    (function($) {
        /*———————————————————————————————导航栏固定——————————————————————————————————*/
        jQuery(window).bind('scroll', function() { /*给浏览器窗口绑定一个scroll事件*/
            if ($(window).scrollTop() > 200) {
                $('#mu-header').addClass('mu-fixed-nav');
            } else {
                $('#mu-header').removeClass('mu-fixed-nav');
            }
        });


        /*———————————————————————————————底部信息栏(需完善)——————————————————————————————————*/
        var viewW = $(window).width(); //浏览器高度 
        if (viewW < 767) { //移动页面
            $('.footerbg').addClass('hidden');
        }
        jQuery(window).resize(function() { //实时
            var viewH = $(window).height(); //浏览器高度 
            if (viewH > 600) {
                $('.footerbg').removeClass('hidden');
            } else if (viewH < 600) {
                $('.footerbg').addClass('hidden');
            }

        });

    })(jQuery);
    </script>
</body>

</html>